]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Adapt to new size-change API
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 6 Jul 2015 04:16:33 +0000 (21:16 -0700)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 6 Jul 2015 06:09:24 +0000 (23:09 -0700)
We don't implement any maximize transitions (yet??), but we still have
the skeleton there. Let's keep it up to date.

js/ui/windowManager.js
src/gnome-shell-plugin.c
src/shell-wm-private.h
src/shell-wm.c
src/shell-wm.h

index e373723174c62105b6a6848e4d3869f0a378566c..a3a1c66dfbfbd7233d1624e31739eba5f7be381a 100644 (file)
@@ -19,8 +19,6 @@ const Tweener = imports.ui.tweener;
 const WindowMenu = imports.ui.windowMenu;
 
 const SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings';
-const MAXIMIZE_WINDOW_ANIMATION_TIME = 0.15;
-const UNMAXIMIZE_WINDOW_ANIMATION_TIME = 0.15;
 const MINIMIZE_WINDOW_ANIMATION_TIME = 0.2;
 const SHOW_WINDOW_ANIMATION_TIME = 0.15;
 const DIALOG_SHOW_WINDOW_ANIMATION_TIME = 0.1;
@@ -624,8 +622,6 @@ const WindowManager = new Lang.Class({
 
         this._minimizing = [];
         this._unminimizing = [];
-        this._maximizing = [];
-        this._unmaximizing = [];
         this._mapping = [];
         this._destroying = [];
         this._movingWindow = null;
@@ -640,8 +636,6 @@ const WindowManager = new Lang.Class({
         this._shellwm.connect('kill-switch-workspace', Lang.bind(this, this._switchWorkspaceDone));
         this._shellwm.connect('kill-window-effects', Lang.bind(this, function (shellwm, actor) {
             this._minimizeWindowDone(shellwm, actor);
-            this._maximizeWindowDone(shellwm, actor);
-            this._unmaximizeWindowDone(shellwm, actor);
             this._mapWindowDone(shellwm, actor);
             this._destroyWindowDone(shellwm, actor);
         }));
@@ -652,8 +646,6 @@ const WindowManager = new Lang.Class({
         this._shellwm.connect('show-window-menu', Lang.bind(this, this._showWindowMenu));
         this._shellwm.connect('minimize', Lang.bind(this, this._minimizeWindow));
         this._shellwm.connect('unminimize', Lang.bind(this, this._unminimizeWindow));
-        this._shellwm.connect('maximize', Lang.bind(this, this._maximizeWindow));
-        this._shellwm.connect('unmaximize', Lang.bind(this, this._unmaximizeWindow));
         this._shellwm.connect('map', Lang.bind(this, this._mapWindow));
         this._shellwm.connect('destroy', Lang.bind(this, this._destroyWindow));
         this._shellwm.connect('filter-keybinding', Lang.bind(this, this._filterKeybinding));
@@ -1163,22 +1155,8 @@ const WindowManager = new Lang.Class({
         }
     },
 
-
-    _maximizeWindow : function(shellwm, actor, targetX, targetY, targetWidth, targetHeight) {
-        shellwm.completed_maximize(actor);
-    },
-
-    _maximizeWindowDone : function(shellwm, actor) {
-    },
-
-    _maximizeWindowOverwrite : function(shellwm, actor) {
-    },
-
-    _unmaximizeWindow : function(shellwm, actor, targetX, targetY, targetWidth, targetHeight) {
-        shellwm.completed_unmaximize(actor);
-    },
-
-    _unmaximizeWindowDone : function(shellwm, actor) {
+    _sizeChangeWindow : function(shellwm, actor, whichChange, oldFrameRect, oldBufferRect) {
+        shellwm.completed_size_change(actor);
     },
 
     _hasAttachedDialogs: function(window, ignoreWindow) {
index a7266ef7dc0a157fbaf4ce4784b4b443730c1f29..05d09af9dd24dff3f2d1474bb85dd0dea7de121e 100644 (file)
@@ -42,18 +42,11 @@ static void gnome_shell_plugin_minimize         (MetaPlugin          *plugin,
                                                  MetaWindowActor     *actor);
 static void gnome_shell_plugin_unminimize       (MetaPlugin          *plugin,
                                                  MetaWindowActor     *actor);
-static void gnome_shell_plugin_maximize         (MetaPlugin          *plugin,
+static void gnome_shell_plugin_size_change      (MetaPlugin          *plugin,
                                                  MetaWindowActor     *actor,
-                                                 gint                 x,
-                                                 gint                 y,
-                                                 gint                 width,
-                                                 gint                 height);
-static void gnome_shell_plugin_unmaximize       (MetaPlugin          *plugin,
-                                                 MetaWindowActor     *actor,
-                                                 gint                 x,
-                                                 gint                 y,
-                                                 gint                 width,
-                                                 gint                 height);
+                                                 MetaSizeChange       which_change,
+                                                 MetaRectangle       *old_rect,
+                                                 MetaRectangle       *new_rect);
 static void gnome_shell_plugin_map              (MetaPlugin          *plugin,
                                                  MetaWindowActor     *actor);
 static void gnome_shell_plugin_destroy          (MetaPlugin          *plugin,
@@ -134,8 +127,7 @@ gnome_shell_plugin_class_init (GnomeShellPluginClass *klass)
   plugin_class->map              = gnome_shell_plugin_map;
   plugin_class->minimize         = gnome_shell_plugin_minimize;
   plugin_class->unminimize       = gnome_shell_plugin_unminimize;
-  plugin_class->maximize         = gnome_shell_plugin_maximize;
-  plugin_class->unmaximize       = gnome_shell_plugin_unmaximize;
+  plugin_class->size_change      = gnome_shell_plugin_size_change;
   plugin_class->destroy          = gnome_shell_plugin_destroy;
 
   plugin_class->switch_workspace = gnome_shell_plugin_switch_workspace;
@@ -281,27 +273,13 @@ gnome_shell_plugin_unminimize (MetaPlugin         *plugin,
 }
 
 static void
-gnome_shell_plugin_maximize (MetaPlugin         *plugin,
-                             MetaWindowActor    *actor,
-                             gint                x,
-                             gint                y,
-                             gint                width,
-                             gint                height)
-{
-  _shell_wm_maximize (get_shell_wm (),
-                      actor, x, y, width, height);
-}
-
-static void
-gnome_shell_plugin_unmaximize (MetaPlugin         *plugin,
-                               MetaWindowActor    *actor,
-                               gint                x,
-                               gint                y,
-                               gint                width,
-                               gint                height)
+gnome_shell_plugin_size_change (MetaPlugin         *plugin,
+                                MetaWindowActor    *actor,
+                                MetaSizeChange      which_change,
+                                MetaRectangle      *old_frame_rect,
+                                MetaRectangle      *old_buffer_rect)
 {
-  _shell_wm_unmaximize (get_shell_wm (),
-                        actor, x, y, width, height);
+  _shell_wm_size_change (get_shell_wm (), actor, which_change, old_frame_rect, old_buffer_rect);
 }
 
 static void
index de260f2f5a040ad83371bb7eba1e8545c1713434..f9c6aa9402a569c1dbfa202656e92bde34b8cb2f 100644 (file)
@@ -12,18 +12,11 @@ void _shell_wm_minimize   (ShellWM         *wm,
                            MetaWindowActor *actor);
 void _shell_wm_unminimize (ShellWM         *wm,
                            MetaWindowActor *actor);
-void _shell_wm_maximize   (ShellWM         *wm,
+void _shell_wm_size_change(ShellWM         *wm,
                            MetaWindowActor *actor,
-                           gint             x,
-                           gint             y,
-                           gint             width,
-                           gint             height);
-void _shell_wm_unmaximize (ShellWM         *wm,
-                           MetaWindowActor *actor,
-                           gint             x,
-                           gint             y,
-                           gint             width,
-                           gint             height);
+                           MetaSizeChange   which_change,
+                           MetaRectangle   *old_rect,
+                           MetaRectangle   *new_rect);
 void _shell_wm_map        (ShellWM         *wm,
                            MetaWindowActor *actor);
 void _shell_wm_destroy    (ShellWM         *wm,
index 4b58df6c593260968faa86dc097327876360c589..bc50fb61f527aeda83e30a57c762038675860584 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <string.h>
 
+#include <meta/meta-enum-types.h>
 #include <meta/keybindings.h>
 
 #include "shell-wm-private.h"
@@ -20,8 +21,7 @@ enum
 {
   MINIMIZE,
   UNMINIMIZE,
-  MAXIMIZE,
-  UNMAXIMIZE,
+  SIZE_CHANGE,
   MAP,
   DESTROY,
   SWITCH_WORKSPACE,
@@ -74,22 +74,14 @@ shell_wm_class_init (ShellWMClass *klass)
                   NULL, NULL, NULL,
                   G_TYPE_NONE, 1,
                   META_TYPE_WINDOW_ACTOR);
-  shell_wm_signals[MAXIMIZE] =
-    g_signal_new ("maximize",
+  shell_wm_signals[SIZE_CHANGE] =
+    g_signal_new ("size-change",
                   G_TYPE_FROM_CLASS (klass),
                   G_SIGNAL_RUN_LAST,
                   0,
                   NULL, NULL, NULL,
-                  G_TYPE_NONE, 5,
-                  META_TYPE_WINDOW_ACTOR, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
-  shell_wm_signals[UNMAXIMIZE] =
-    g_signal_new ("unmaximize",
-                  G_TYPE_FROM_CLASS (klass),
-                  G_SIGNAL_RUN_LAST,
-                  0,
-                  NULL, NULL, NULL,
-                  G_TYPE_NONE, 5,
-                  META_TYPE_WINDOW_ACTOR, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
+                  G_TYPE_NONE, 4,
+                  META_TYPE_WINDOW_ACTOR, META_TYPE_SIZE_CHANGE, META_TYPE_RECTANGLE, META_TYPE_RECTANGLE);
   shell_wm_signals[MAP] =
     g_signal_new ("map",
                   G_TYPE_FROM_CLASS (klass),
@@ -220,32 +212,11 @@ shell_wm_completed_unminimize (ShellWM         *wm,
   meta_plugin_unminimize_completed (wm->plugin, actor);
 }
 
-/**
- * shell_wm_completed_maximize:
- * @wm: the ShellWM
- * @actor: the MetaWindowActor actor
- *
- * The plugin must call this when it has completed a window maximize effect.
- **/
-void
-shell_wm_completed_maximize (ShellWM         *wm,
-                             MetaWindowActor *actor)
-{
-  meta_plugin_maximize_completed (wm->plugin, actor);
-}
-
-/**
- * shell_wm_completed_unmaximize:
- * @wm: the ShellWM
- * @actor: the MetaWindowActor actor
- *
- * The plugin must call this when it has completed a window unmaximize effect.
- **/
 void
-shell_wm_completed_unmaximize (ShellWM         *wm,
-                               MetaWindowActor *actor)
+shell_wm_completed_size_change (ShellWM         *wm,
+                                MetaWindowActor *actor)
 {
-  meta_plugin_unmaximize_completed (wm->plugin, actor);
+  meta_plugin_size_change_completed (wm->plugin, actor);
 }
 
 /**
@@ -359,25 +330,13 @@ _shell_wm_unminimize (ShellWM         *wm,
 }
 
 void
-_shell_wm_maximize (ShellWM         *wm,
-                    MetaWindowActor *actor,
-                    int              target_x,
-                    int              target_y,
-                    int              target_width,
-                    int              target_height)
-{
-  g_signal_emit (wm, shell_wm_signals[MAXIMIZE], 0, actor, target_x, target_y, target_width, target_height);
-}
-
-void
-_shell_wm_unmaximize (ShellWM         *wm,
-                      MetaWindowActor *actor,
-                      int              target_x,
-                      int              target_y,
-                      int              target_width,
-                      int              target_height)
+_shell_wm_size_change (ShellWM         *wm,
+                       MetaWindowActor *actor,
+                       MetaSizeChange   which_change,
+                       MetaRectangle   *old_frame_rect,
+                       MetaRectangle   *old_buffer_rect)
 {
-  g_signal_emit (wm, shell_wm_signals[UNMAXIMIZE], 0, actor, target_x, target_y, target_width, target_height);
+  g_signal_emit (wm, shell_wm_signals[SIZE_CHANGE], 0, actor, which_change, old_frame_rect, old_buffer_rect);
 }
 
 void
index 7cd8948d88c89ca33f4b2ffba5781dc7418d4971..57b8c630e48651ab5fa7a481a1723d403bbdaccf 100644 (file)
@@ -31,9 +31,7 @@ void     shell_wm_completed_minimize         (ShellWM         *wm,
                                               MetaWindowActor *actor);
 void     shell_wm_completed_unminimize       (ShellWM         *wm,
                                               MetaWindowActor *actor);
-void     shell_wm_completed_maximize         (ShellWM         *wm,
-                                              MetaWindowActor *actor);
-void     shell_wm_completed_unmaximize       (ShellWM         *wm,
+void     shell_wm_completed_size_change      (ShellWM         *wm,
                                               MetaWindowActor *actor);
 void     shell_wm_completed_map              (ShellWM         *wm,
                                               MetaWindowActor *actor);